package models

import (
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

func Init() {
	dbhost := "127.0.0.1"
	dbport := "3306"
	dbuser := "root"
	dbpassword := ""
	dbname := "mmap"
	dsn := dbuser + ":" + dbpassword + "@tcp(" + dbhost + ":" + dbport + ")/" + dbname + "?charset=utf8&loc=Local"

	orm.RegisterDataBase("default", "mysql", dsn)
	orm.RegisterModel(new(Admin), new(Config), new(Cases),new(Company),new(Staff))
	o := orm.NewOrm()
	o.Using("default")
}
